home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / graphics / 3dedb09.zip / DEMO.C < prev    next >
C/C++ Source or Header  |  1993-05-21  |  1KB  |  40 lines

  1. #include "3d.h"
  2.  
  3.  
  4.  
  5.  
  6.  
  7. void main(int argc,char *argv[]) {
  8. struct newobj *DemoObject;
  9. int zmod=50;
  10. int n;
  11. if (argc!=2) {
  12. printf("Don't do that. Use DEMO file-to-watch\n");
  13. return;
  14. }
  15. ordscreen();            /*Set up the screenmode and load the standard*/
  16.                 /*palette.*/
  17. DemoObject=loadobj(argv[1]);    /*Load the Object*/
  18. if (DemoObject==NULL) {
  19. textscreen();                             /*Return to dos if anything goes*/
  20. printf("File %s doesn't exist\n",argv[1]);/*wrong. Restore screen mode*/
  21. return;
  22. }
  23. for (n=0;n!=200;n++) {
  24. //DemoObject->pos.z+=zmod;
  25. if ((DemoObject->pos.z+=zmod)>4000)/*Move object in Z-direction*/
  26. zmod=-50;
  27. if (DemoObject->pos.z<800)
  28. zmod=50;
  29. DemoObject->rot.y+=10; /*Rotate the object*/
  30. DemoObject->rot.z+=5;
  31. rotobj(DemoObject);    /*Do the rotation*/
  32. DrawObject(DemoObject);/*Add DemoObject to the Drawlist*/
  33. DrawThemAll();         /*Draw everything*/
  34. flippage();            /*And show on the screen by page-flipping*/
  35. }
  36. textscreen();
  37. printf("Thanks you for trying this program\n");
  38. }
  39.  
  40.